package com.gray.wow.domain;

import java.io.Serializable;
import java.util.Date;

import com.gray.wow.common.DateUtil;
import com.gray.wow.common.Role;

public class User implements Serializable {

	private static final long serialVersionUID = 1L;

	private Integer id;

	//@Pattern(regexp = "w{4,30}")
	// 匹配4-30个数字和字母以及下划线的字符
	private String username;

	// @Pattern(regexp="S{6,30}")//匹配6-30个非空白字符
	private String password;
	
	
	private String role;
	private Date createTime;
	private Date modifyTime;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getRole() {
		return role;
	}

	public String getRoleName() {

		return Role.getName(role);
	}

	public void setRole(String role) {
		this.role = role;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public String getCreateTimeStr() {
		return DateUtil.getDateStr("yyyy-MM-dd HH:mm", createTime);
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getModifyTime() {
		return modifyTime;
	}

	public void setModifyTime(Date modifyTime) {
		this.modifyTime = modifyTime;
	}

	public void say(String str) {
		System.out.println("user say" + str + "!");
	}
}